<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <div id="app">
          <form action="http://10.104.239.95:8080/user" method="post">
        账号:<input type="text" id="username" name="username"><br>
        密码:<input type="text" id="password" name="password">
        <input type="submit">
     </form>

      <h2>以json格式提交</h2>

      账号:<input type="text" v-model="username" ><br>
      密码:<input type="text" v-model="password" ><br>
      <button @click="submit">提交</button>
 
    </div>

   

 
<script src="../js/axios.js"></script>
<script src="../js/vue.js"></script>
 <script>
 
   new Vue({
    el:"#app",
    data:{
       username:"",
       password:""

    },
    methods:{
     submit(){
         axios.post("http://10.104.239.95:8080/user",
         {
           "user":this.username,
           "pass":this.password
         }).then((res)=>{
            console.log(res.data);
         })
 
       

      }


    }
   })
 



   




 </script>



</body>
</html>